package com.park.manage.controller;

import com.github.pagehelper.PageInfo;
import com.park.controller.BaseController;
import com.park.entity.mer.MerUserInfo;
import com.park.entity.mer.MerUserItem;
import com.park.entity.page.PageInfoParm;
import com.park.manage.service.meruser.MerUserService;
import com.park.response.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * @title: ParkManagerController
 * @projectName park
 * @description: 商户管理
 * @date 2020/5/510:17
 */
@RestController
@RequestMapping(value = "/wx/manage/mer")
public class MerManagerController extends BaseController {

    @Autowired
    private MerUserService merUserService;

       /**
       　　* @description: 商户添加
       　　* @param MerUserInfo
       　　* @return {@link null}
       　　* @throws
       　　* @author ZhangHaiWen
       　　* @version 2.0
       　　* @date 2020/5/5 10:25
       　　*/
    @RequestMapping(value = "/add",method = RequestMethod.POST)
    public Result add(@RequestBody MerUserInfo merUserInfo){
        merUserService.add(merUserInfo);
        return SUCCESS();
    }

    /**
     　　* @description:  商户列表 金额总价都是自己支付过的
     　　* @param []
     　　* @return {@link Result}
     　　* @throws
     　　* @author ZhangHaiWen
     　　* @version 2.0
     　　* @date 2020/5/5 12:35
     　　*/
    @RequestMapping(value = "/list",method = RequestMethod.POST)
    public Result list(@RequestBody PageInfoParm pageInfoParm){
        PageInfo<MerUserItem> pageInfo = merUserService.list(pageInfoParm);
        return SUCCESS(pageInfo);
    }


}
